// @ts-ignore
/* eslint-disable */
import {request} from 'umi';

/** 根据ID查询接口信息 GET /api/interfaceinfo/${param0} */
export async function getInterfaceInfoByIdUsingGET(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.IdRequest,
  options?: { [key: string]: any },
) {

  return request<API.BaseResponseInterfaceInfo_>(`/api/interfaceinfo/id`, {
    method: 'GET',
    params: {
      ...params
    },
    ...(options || {}),
  });
}

/** 根据ID删除接口信息 DELETE /api/interfaceinfo/${param0} */
export async function deleteInterfaceInfoByIdUsingDELETE(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.deleteInterfaceInfoByIdUsingDELETEParams,
  options?: { [key: string]: any },
) {
  const {id: param0, ...queryParams} = params;
  return request<API.BaseResponseInterfaceInfo_>(`/api/interfaceinfo/${param0}`, {
    method: 'DELETE',
    params: {...queryParams},
    ...(options || {}),
  });
}

/** 新增接口信息 POST /api/interfaceinfo/add */
export async function addInterfaceInfoUsingPOST(
  body: API.InterfaceInfoAddRequest,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseInterfaceInfo_>('/api/interfaceinfo/add', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

export async function updateInterfaceInfoUsingPOST(
  body: API.InterfaceInfoUpdateRequest,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseInterfaceInfo_>('/api/interfaceinfo/update', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 模拟调用接口 POST /api/interfaceinfo/invoke */
export async function invokeUsingPOST(
  body: API.InterfaceInfoInvokeRequest,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseString_>('/api/interfaceinfo/invoke', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 接口下线 PUT /api/interfaceinfo/offline */
export async function offlineUsingPUT(body: API.IdRequest, options?: { [key: string]: any }) {
  return request<API.BaseResponseInterfaceInfo_>('/api/interfaceinfo/offline', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 接口上线 PUT /api/interfaceinfo/online */
export async function onlineUsingPUT(body: API.IdRequest, options?: { [key: string]: any }) {
  return request<API.BaseResponseInterfaceInfo_>('/api/interfaceinfo/online', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 分页查询接口信息 GET /api/interfaceinfo/query */
export async function paginationQueryUsingGET(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.paginationQueryUsingGETParams,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponsePageVoInterfaceInfo>('/api/interfaceinfo/query', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}
